//
//  ZHViewController.m
//  ZHRouter
//
//  Created by Arthur on 08/24/2019.
//  Copyright (c) 2019 Arthur. All rights reserved.
//

#import "ZHViewController.h"
#import "ZHRouter.h"
#import "ZHBlogServiceProtocol.h"

@interface ZHViewController ()

@end

@implementation ZHViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
}



- (IBAction)click:(UIButton *)sender {
    
    /**
     参数解释：
     GlobalScheme: com.gonghui.zh
     路由跳转类型：jump.ctmediator.zh 以CTMediator类型跳转
     路由注册标记：blogvc
     后边都是参数：url=http://www.gonghuizhudi.com&name=zhangsan&aga=18
     页面切换类型：#present 或者 #push
     */
    
    
    /**
     ** 直接进行跳转 一般后台传过来链接可以直接扔进去
     [ZHRouter openURL:[NSURL URLWithString:str]];
     
     ** 可以额外添加参数
     [ZHRouter openURL:[NSURL URLWithString:str] withParams:@{@"class":@"一年级三班"}];
     */
    
NSString *str = @"com.gonghui.zh://vc.jump.zh/blogvc/?name=zhangsan&aga=18";

if ([ZHRouter canOpenURL:[NSURL URLWithString:str]]) {
    
    [ZHRouter openURL:[NSURL URLWithString:str] withParams:@{@"class":@"class3"}];
}
    
    
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
